package com.qf.controller;

import com.qf.dto.ProductTypeDTO;
import com.qf.service.ProductTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author LiuLiang
 * @Date 2020/3/9
 */
@Controller
//@RequestMapping("/web")
public class ProductTypeController {

    @Autowired
    private ProductTypeService productTypeService;

    @RequestMapping("/index")
    //@ResponseBody
    public String index(Model model){
        List<ProductTypeDTO> productTypeList = productTypeService.selectAll();
        model.addAttribute("productTypeList",productTypeList);
        return "index";
    }

}
